function genTrainingCmd2(NetPath, DesPath, weights)
if nargin == 0
    NetPath = '/home/wks/SR-Works/%ExpResult/VDSR0-VDSR-Scale(4)/VDSR_y1';
    % DesPath = fileparts(SrcPath);
    DesPath = NetPath;
    weights.alias = 'VDSR3';
    weights.file = '/home/wks/SR-Works/%result/reimple_VDSR-1/models/myVDSR_fr_msra_x4/myVDSR_fr_msra_x4_iter_134000.caffemodel';
    mycaffe.genTrainingCmd2(NetPath, DesPath, weights.alias, weights.file);
    return
end

%%
Model = mkst('models');

%%
Solver = mkst('solver.prototxt');

copyfile(Solver.src, Solver.des);
Solver.content = strrep(Solver.content, Model.src, Model.des);

mycaffe.net.genFile(Solver.des, Solver.content);

%%
Train = mkst('training.sh');
Train.content = strrep(Train.content, Solver.src, Solver.des);
if ~isempty(weights.file)
    k = strfind(Train.content, '--gpu');
    Train.content = [Train.content(1 : k-1) sprintf('--weights.file "%s" \\\n', weights.file), Train.content(k : end)];
end
mycaffe.net.genFile(Train.des, Train.content);

%%
    function st = mkst(old)
        st.src = fullfile(NetPath, old);
        [~, File, ext] = fileparts(old);
        st.des = fullfile(DesPath, sprintf('%s_%s%s', File, weights.alias, ext));
        if isdir(st.src)
            mkdir(st.des);
        else
            st.content = fileread(st.src);
        end
    end
end